/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bm.config.server;

import com.bm.util.MessagePrinter;
import javax.sql.DataSource;
import org.postgresql.jdbc3.Jdbc3SimpleDataSource;
import com.bm.util.PropertiesHandler;
import java.io.IOException;

/**
 *
 * @author LENOVO
 */
public class IServerServices {
    
    private final PropertiesHandler properties;

    public IServerServices() throws IOException {
        this.properties = new PropertiesHandler();
    }

    public DataSource getLocalDBConfig() {
        Jdbc3SimpleDataSource ds = new Jdbc3SimpleDataSource();
        MessagePrinter.printDebug("Connecting to db "+properties.getServerDbName()+" "+properties.getServerDbUsername()+"@"+properties.getServerDbHost()+":"+properties.getPorts()+"");
        ds.setServerName(properties.getServerDbHost());
        ds.setPortNumber(properties.getPorts());
        ds.setDatabaseName(properties.getServerDbName());
        ds.setUser(properties.getServerDbUsername());
        ds.setPassword(properties.getServerDbPassword());
        return ds;
    }
}
